﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;

namespace YJKTextDimension.Utility
{
	public class ConnectionDimensionFilter : ISelectionFilter
	{
		public bool AllowElement(Element elem)
		{
			if (elem is Dimension)
			{
				Dimension dimension = elem as Dimension;
				if (dimension.DimensionShape == null && dimension.References != null && dimension.References.Size > 0)
				{
					return true;
				}
			}
			return false;
		}

		public bool AllowReference(Reference reference, XYZ position)
		{
			throw new NotImplementedException();
		}
	}
}
